<form method="post" name="userForm" id="userForm" action="/FinalProject/app/userManagement">
	<fieldset>
		<legend>
		 	Fields marked with (*) are required
		</legend>
		<table width="100%">
			<tr>
				<td align="left">
					<label>
						User login
						<span class="red-marker">
							*
						</span>:
					</label>
				</td>
				<td align="right">
					<input type="text" name="userLogin" id="userLogin" dojoType="dijit.form.ValidationTextBox" required="true" promptMessage="Enter login name." invalidMessage="Login name is required."/>
				</td>
				<td class="errorMessage">
				</td>
			</tr>

			<tr>
				<td align="left">
					<label>
						First name
						<span class="red-marker">
							*
						</span>:
					</label>
				</td>
				<td align="right">
					<input type="text" name="firstName" id="firstName" dojoType="dijit.form.ValidationTextBox" required="true" promptMessage="Enter first name." invalidMessage="First name is required."/>
				</td>
				<td class="errorMessage">
				</td>
			</tr>
			<tr>
				<td align="left">
					<label>
						Last name:
					</label>
				</td>
				<td align="right">
					<input type="text" name="lastName" id="lastName" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter last name." />
				</td>
				<td class="errorMessage">
				</td>
			</tr>
			<tr>
				<td align="left">
					<label>
						Phone number:
					</label>
				</td>
				<td align="right">
					<input type="text" name="phoneNumber" id="phoneNumber" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter slots count." />
				</td>
			</tr>
			<%
				if ( request.isUserInRole( "manager")) {
			%>
				<tr>
					<td align="left">
						<label>
							Activity status:
						</label>
					</td>
					<td align="right">
						<input type="text" name="activityStatus" id="activityStatus" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'yyyy-MM-dd'}"/>
					</td>
				</tr>
				<tr>
					<td align="left">
						<label>
							User role:
						</label>
					</td>
					<td align="right">
						<select name="role" id="role" dojoType="dijit.form.ComboBox" >
							<option value="manager" id="managerOp">manager</option>
							<option value="researcher" id="researcherOp">researcher</option>
						</select>
					</td>
				</tr>
			<%
				}
			%>
			<tr>
				<td colspan=3 align="right">
					<button type="button" dojoType="dijit.form.Button" id="dlgResetButton">
						Cancel
					</button>
					<button type="button" dojoType="dijit.form.Button" id="dlgSubmitButton">
						Submit
					</button>
				</td>
			</tr>
		</table>
	</fieldset>
	<input type="hidden" name="userOp" id="userOp" value="USER_UPDATE" />
</form>
<script type="text/javascript">
	dojo.addOnLoad( function( ) {
		var defineHandler = function( ) {
			if ( !dijit.byId( "userLogin"))
				setTimeout( defineHandler, 500);
			else
				dijit.byId( "userLogin").attr( "disabled", "true");
		};
		defineHandler( );
	});
</script>